import sys
import os

def sum_values(file_name):
	sum = 0
	with open(file_name, 'r') as reader:
		line = reader.readline()
		while line <> '':
			sum += int(line)
			line = reader.readline()
	return sum

if __name__ == '__main__':
	if len(sys.argv) < 2:
		print 'Usage: SumLines.py [file_name]'
		sys.exit()
	
	if not os.path.exists(sys.argv[1]):
		print 'File does not exist: ', sys.argv[1]
		sys.exit()
		
	print 'The sum is {0}.'.format(str(sum_values(sys.argv[1])))
